﻿<phone:PhoneApplicationPage 
    x:Class="CloudWallet.WalletItemDetailPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">
    <phone:PhoneApplicationPage.Resources>
        <Storyboard x:Name="SB_EditOpen">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="EditPanel">
                <EasingDoubleKeyFrame KeyTime="0" Value="675"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <QuarticEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="SB_EditClose">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="EditPanel">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="675">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <QuarticEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="#FFF79646">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="{Binding AppTitle, Mode=OneTime}" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="{Binding Title}" TextTrimming="WordEllipsis" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
                <TextBlock Text="{Binding Content}" TextWrapping="Wrap" FontSize="28" />
            </ScrollViewer>
        </Grid>
        <Grid x:Name="EditPanel" Grid.Row="1" Margin="12,-50,12,70" Visibility="Collapsed" Background="#FF220040" RenderTransformOrigin="0.5,0.5">
            <Grid.RenderTransform>
                <CompositeTransform/>
            </Grid.RenderTransform>
            <Grid.RowDefinitions>
                <RowDefinition Height="40" />
                <RowDefinition Height="80" />
                <RowDefinition Height="40" />
                <RowDefinition />
                <RowDefinition Height="80" />
            </Grid.RowDefinitions>
            <TextBlock Foreground="Gray" FontSize="18" Text="Title" VerticalAlignment="Bottom" Margin="20,3" />
            <TextBox Grid.Row="1" FontSize="28" Margin="3" Text="{Binding Title, Mode=TwoWay}" />
            <TextBlock Grid.Row="2" Foreground="Gray" FontSize="18" Text="Content" VerticalAlignment="Bottom" Margin="20,3" />
            <TextBox Grid.Row="3" FontSize="28" Margin="3" 
                     Text="{Binding Content, Mode=TwoWay}" 
                     TextWrapping="Wrap" AcceptsReturn="True" 
                     ScrollViewer.VerticalScrollBarVisibility="Auto" />
            <Button Grid.Row="4" x:Name="btnCloseEdit" Content="Done" Width="300" FontSize="30" Click="btnCloseEdit_Click" />
        </Grid>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="btnEdit" Text="Edit" Click="btnEdit_Click" />
                <shell:ApplicationBarMenuItem x:Name="btnDelete" Text="Delete" Click="btnDelete_Click" />
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
